package com.ml.mall.service.coupon;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ml.mall.bean.base.ApiRestResult;
import com.ml.mall.bean.page.Page;
import com.ml.mall.bean.req.coupon.CouponEditDto;
import com.ml.mall.bean.req.coupon.CouponNewDto;
import com.ml.mall.bean.req.coupon.CouponQueryDto;
import com.ml.mall.bean.req.coupon.CouponQueryOneDto;
import com.ml.mall.bean.res.coupon.CouponQueryInfoRes;
import com.ml.mall.bean.res.coupon.CouponQueryRes;
import com.ml.mall.bean.vo.coupon.CouponVo;
import com.ml.mall.bean.vo.coupon.UsableCouponVo;
import com.ml.mall.entity.coupon.SysCoupon;
import com.ml.mall.entity.sys.SysUser;

import java.util.List;

public interface SysCouponService extends IService<SysCoupon>{

    /**
     * @description    :创建优惠券
     * @author         :zxm
     * @date           :2021/5/21
    **/
    ApiRestResult createCoupon(CouponNewDto dto, SysUser user);

    /**
     * @description    :修改优惠券
     * @author         :zxm
     * @date           :2021/5/21
    **/
    ApiRestResult editCoupon(CouponEditDto dto);

    /**
     * @description    :删除优惠券
     * @author         :zxm
     * @date           :2021/5/21
    **/
    ApiRestResult removeCoupon(List<Long> ids);

    /**
     * @description    :分页查询优惠券
     * @author         :zxm
     * @date           :2021/5/21
    **/
    Page<CouponQueryRes> queryPageCoupon(CouponQueryDto dto);

    /**
     * @description    :查询单个优惠券
     * @author         :zxm
     * @date           :2021/5/21
    **/
    CouponQueryInfoRes queryOneCoupon(CouponQueryOneDto dto);

    /**
     * @description    :更新优惠券使用数量
     * @author         :zxm
     * @date           :2021/5/24
    **/
    int editCouponUseAmount(String couponCode);

    /**
     * @description    :内部接口可用优惠券
     * @author         :zxm
     * @date           :2021/5/24
    **/
    List<UsableCouponVo> queryUsableCoupon(CouponVo vo);

    /**
     * @description    :内部检测多张优惠券是否可以一起使用
     * @author         :zxm
     * @date           :2021/5/28
    **/
    Boolean checkMultiCoupon(List<SysCoupon> dbCouponList);

    Boolean checkHaveAdminCouppon();
}
